#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f^=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
map<int,int>vis;
int p=0,a[1111111];
signed main(){
	srand(time(0));
	int sum=0,res=0;
	for(int i=1;i<=1e5;i++){
		sum+=(rand()&1?1:-1)*(rand()%1001);
		if(!vis[abs(sum)])res++;
		vis[abs(sum)]=1;
		if(abs(sum)>a[p])p=i;
		a[i]=abs(sum);
	}printf("%lld\n",sum);
	printf("%d\n",p);
	return 0;
}

